package com.demoo.zjsu.service.smartwebsite.zjgsu;

import com.demoo.zjsu.model.smartwebsite.PageTwo;
import com.demoo.zjsu.service.smartwebsite.OnlyPhotoResolver;
import com.demoo.zjsu.service.smartwebsite.Page;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.springframework.stereotype.Service;

/**
 * Created by jshjsh on 2016/8/18.
 */
@Service
public class IndexPhotoPageService extends OnlyPhotoResolver{
    @Override
    public PageTwo getPageTwo(Element element) {
        String key = "/"+element.select("img").attr("src");
        String title = element.select(".title").text();
        return new PageTwo(title, "", key, 0);
    }

    @Override
    public Page getPage() {
        return new Page("http://www.zjgsu.edu.cn/","首页轮播图");
    }

    @Override
    public Elements getMain(Document document) {
        return document.select(".pic_lists").select("li");
    }

    @Override
    public void addPhoto(Elements elements) {

    }


}
